package particlesystem.effects {
	import particlesystem.core.ParticleData;
	import particlesystem.utils.Range;

	/**
	 * @author robertthurston
	 */
	public class GravityEffect implements IEffect {

		private var range : Range;

		public function GravityEffect(min : Number, max : Number) {
			range = new Range(min, max);
		}

		public function reset(particleData : ParticleData) : void {
			particleData.gravity = range.range;
		}

		public function update(particleData : ParticleData) : void {
			particleData.ySpeed += particleData.gravity;
		}
	}
}
